<?php
declare (strict_types=1);

namespace app\common\model\store;

use cores\BaseModel;
use think\model\relation\HasOne;

/**
 * 岗位等级记录表模型
 * Class Level
 * @package app\common\model\job
 */
class Level extends BaseModel
{
    // 定义表名
    protected $name = 'job_level';

    // 定义主键
    protected $pk = 'job_level_id';

    /**
     * 追加字段
     * @var array
     */
    protected $append = [];

    /**
     * 学员详情
     * @param $where
     * @param array $with
     * @return array|static|null
     */
    public static function detail($where, array $with = [])
    {
        return static::get($where, $with);
    }

    /**
     * 关联题库信息
     * @return HasOne
     */
    public function question()
    {
        return $this->hasOne('app\common\model\question\Question', 'question_id', 'question_id');
    }
}
